package com.jeecms.wicool.entity.lottery;

import java.sql.Timestamp;
import com.jeecms.wicool.entity.lottery.base.AbstractLotteryConfig;

public class LotteryConfig extends AbstractLotteryConfig implements
		java.io.Serializable ,Comparable<Object>{

	// Constructors

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	/** default constructor */
	public LotteryConfig() {
	}

	/** full constructor */
	public LotteryConfig(Integer id, ActiveConfig activeConfig,
			String prizeName, Integer pro, Integer maxCount, Integer dayCount,
			Integer userMaxCount, Timestamp createTime, Timestamp updateTime,String index) {
		super(id, activeConfig, prizeName, pro, maxCount, dayCount,
				userMaxCount, createTime, updateTime,index);

	}

	@Override
	public int compareTo(Object o) {
		// TODO Auto-generated method stub
		LotteryConfig a=(LotteryConfig) o;
		if(getP()!=null){
		if(getP()<a.getP()){
			return -1;
		}else if(getP()>a.getP()){
			return 1;
		}
		return 0;
	}
		else{
			if(getPrizeName().equals(a.getPrizeName())){
				return 0;
			}
			return -1;
		}
}

}
